// pages/main/main.js

const app=getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    movies:[
      {
        name: 'HTML',
        url: '/pages/Course/course',
        icon: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1537601222&di=e3ac384b80886fdb4c7f9f2b5c585d1f&imgtype=jpg&er=1&src=http%3A%2F%2Fwww.vvfeng.com%2Fdata%2Fupload2%2Fueditor%2F20170912%2F59b7bb4f2041a.png',
        code: '10'
      },
      {
        name: 'Java',
        url: '/pages/Course/course',
        icon: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1537006505784&di=971a7c79b3d513f01a6b81c339c8b93c&imgtype=0&src=http%3A%2F%2Fimg.mp.itc.cn%2Fupload%2F20161010%2Fc5b9a888ca0b4a62bca9c74a5baf8449_th.jpg',
        code: '11'
      },
      {
        name: 'CSS',
        url: '/pages/Course/course',
        icon: '../../images/mine_select.png',
        code: '10'
      }
    ]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    console.log('log')
    var that=this
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
  ,
  sortClick:function(e){
    console.log(e.currentTarget.dataset.tag)
    var str=e.currentTarget.dataset.tag
    if("notice"==str){
      wx.navigateTo({
        url: '../noticelist/noticelist',
        success: function(res){
          // success
        },
        fail: function() {
          // fail
        },
        complete: function() {
          // complete
        }
      })
    } else if ("knoew" == str) {
      wx.navigateTo({
        url: '../knowlist/knowlist',
        success: function (res) {
          // success
        },
        fail: function () {
          // fail
        },
        complete: function () {
          // complete
        }
      })
    } else if ("map" == str) {
      wx.navigateTo({
        url: '../map/map',
        success: function (res) {
          // success
        },
        fail: function () {
          // fail
        },
        complete: function () {
          // complete
        }
      })
    } else if ("mall" == str) {
      wx.navigateTo({
        url: '../malllist/malllist',
        success: function (res) {
          // success
        },
        fail: function () {
          // fail
        },
        complete: function () {
          // complete
        }
      })
    } else if ("service" == str) {
      wx.navigateTo({
        url: '../servicelist/servicelist',
        success: function (res) {
          // success
        },
        fail: function () {
          // fail
        },
        complete: function () {
          // complete
        }
      })
    }
  }
})